import Vue from 'vue'
import store from '@/store/index'
export default function () {
  Vue.directive('has', {                              // 配置对象写法（完整写法）
    inserted(node, binding, vnode) {
      let buttons = store.getters.buttons
      if (buttons.indexOf(binding.value) === -1) {
        node.parentNode.removeChild(node)
      }
    },
  })
}
